import React,{useState} from 'react'
import { JumboTabs } from "antd-mobile"
import Login from '../components/mine/Login'
import Register from '../components/mine/Register'
import  Info from  "../components/mine/Info";

export default function Mine() {
    const [activeKey, setActiveKey] = useState("login");
    let  change = (item:any)=>{
        setActiveKey(item)
    }
    let token  = window.localStorage.getItem("token");
    if(token){
        return  <Info></Info>
    }
    return ( 
            <JumboTabs activeKey={activeKey} onChange={change}>
                <JumboTabs.Tab title='登录' description="" key='login'>
                    <Login></Login>
                </JumboTabs.Tab>
                <JumboTabs.Tab title='注册' description='' key='register'>
                    <Register setActiveKey={setActiveKey}></Register>
                </JumboTabs.Tab>
            </JumboTabs>
       
    )
}
